package com.hhkj.study.admin.article.model.podo;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONUtil;
import com.hhkj.study.admin.article.entity.Article;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
*
* @author SERVER
* @since 2024-09-06
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class ArticleDo extends Article {

    /**
     * 区域id
     */
    private Long provinceId;

    /**
     * 课程类型id
     */
    private Long courseType;

    /**
     * 资讯分类code
     */
    private String catalogCode;

    @Override
    public String getCourseTypes() {
        if (CollectionUtil.isNotEmpty(this.getCourseTypeList())) {
            return JSONUtil.toJsonStr(getCourseTypeList());
        }
        return super.getCourseTypes();
    }

    @Override
    public String getProvinceIds() {
        if (CollectionUtil.isNotEmpty(this.getProvinceIdList())) {
            return JSONUtil.toJsonStr(getProvinceIdList());
        }
        return super.getProvinceIds();
    }
}